/////////////////////////////////////////////////////////////////////////////
// CVIMacros.h
//
// AUTHOR: Tero Pudas
//
// (c) 2007 Nokia Siemens Networks
/////////////////////////////////////////////////////////////////////////////
#ifndef __MACROS_INCL__
#define __MACROS_INCL__

// Memory
#define FREE(pBuffer)            if(pBuffer != NULL) { free(pBuffer); pBuffer = NULL; }
#define CA_FREE(pBuffer)         if(pBuffer != NULL) { CA_FreeMemory(pBuffer); pBuffer = NULL; }
#define CA_DISCARD_OBJ(pHandle)  if(pHandle != NULL) { CA_DiscardObjHandle(pHandle); pHandle = NULL; }
#define EELOG_DISCARD            if(g_hEventLog != 0 || g_hErrorLog != 0) { CA_DISCARD_OBJ(g_hEventLog); CA_DISCARD_OBJ(g_hErrorLog); }  

// double dDbgTimer; // Required for DEBUG_T_PRINT
#define TUWF_DEBUG_PRINT(pszFmtMsg) { dDbgTimer=Timer(); DebugPrintf(pszFmtMsg, dDbgTimer); }

// Return values
#define RET_NON_FATAL            1
#define RET_OK                   0
#define RET_FATAL               -1

// Buffer sizes
#define BUF_SIZE_TINY            128
#define BUF_SIZE_SMALL           256
#define BUF_SIZE                 512
#define BUF_SIZE_MEDIUM          1024
#define BUF_SIZE_LARGE           2048
#define BUF_SIZE_HUGE            4096
#define BUF_SIZE_ENORMOUS        8192

#define BUF_SIZE_1K              1024
#define BUF_SIZE_2K              2048
#define BUF_SIZE_4K              4096
#define BUF_SIZE_8K              8192
#define BUF_SIZE_16K             16384
#define BUF_SIZE_32K             32768
#define BUF_SIZE_128K            131072 
#endif // __MACROS_INCL__
// ************************* 78 character ruler *****************************
//                            End of header file
// **************************************************************************
